CREATE TABLE [dbo].[TDREGI_INSA]
(
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_MODU] [dbo].[TD_VC_008] NOT NULL,
[CO_USUA] [dbo].[TD_VC_008] NOT NULL,
[TI_CONE] [dbo].[TD_VC_003] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDREGI_IN__NU_SE__30F848ED] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDREGI_IN__CO_US__31EC6D26] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDREGI_IN__FE_US__32E0915F] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDREGI_IN__CO_US__33D4B598] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDREGI_IN__FE_US__34C8D9D1] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDREGI_INSA] ADD CONSTRAINT [PK__TDREGI_I__9A239BE9668030F6] PRIMARY KEY CLUSTERED  ([CO_SIST], [CO_MODU], [CO_USUA], [TI_CONE], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDREGI_INSA] ADD CONSTRAINT [FK__TDREGI_INSA__2630A1B7] FOREIGN KEY ([CO_SIST], [CO_MODU]) REFERENCES [dbo].[TMMODU_SIST] ([CO_SIST], [CO_MODU])
GO
ALTER TABLE [dbo].[TDREGI_INSA] ADD CONSTRAINT [FK__TDREGI_IN__CO_US__253C7D7E] FOREIGN KEY ([CO_USUA]) REFERENCES [dbo].[TMUSUA] ([CO_USUA])
GO
GRANT SELECT ON  [dbo].[TDREGI_INSA] TO [public]
GRANT INSERT ON  [dbo].[TDREGI_INSA] TO [public]
GRANT DELETE ON  [dbo].[TDREGI_INSA] TO [public]
GRANT UPDATE ON  [dbo].[TDREGI_INSA] TO [public]
GO
